package com.micro.ai.commons.exception;

import lombok.Getter;

import java.util.List;
import java.util.Map;

/**
 * 参数验证异常
 * 
 * @author micro-ai
 * @since 0.0.1
 */
@Getter
public class ValidationException extends BusinessException {

    private static final long serialVersionUID = 1L;

    /**
     * 验证错误详情
     */
    private final Map<String, List<String>> errors;

    /**
     * 构造函数
     */
    public ValidationException(String message) {
        super("A0010", message);
        this.errors = null;
    }

    /**
     * 构造函数
     */
    public ValidationException(String message, Map<String, List<String>> errors) {
        super("A0010", message);
        this.errors = errors;
    }

    /**
     * 构造函数
     */
    public ValidationException(String message, Throwable cause) {
        super("A0010", message, cause);
        this.errors = null;
    }

    /**
     * 构造函数
     */
    public ValidationException(String message, Map<String, List<String>> errors, Throwable cause) {
        super("A0010", message, cause);
        this.errors = errors;
    }
}
